using System;
using System.Collections.Generic;
using System.Collections.Specialized;

// 有序哈希表测试类
public class OrderHashTableTest
{
    public static void RunTest()
    {
        Dictionary<int, int> dictionary = new Dictionary<int, int>();
        dictionary.Add(1, 1);
        dictionary.Add(2, 2);
        dictionary.Add(3, 3);
        dictionary.Add(10, 4);
        dictionary.Add(11, 5);
        dictionary.Add(12, 6);

        OrderedDictionary orderDictionary = new OrderedDictionary();
        orderDictionary.Add(1, 1);
        orderDictionary.Add(2, 2);
        orderDictionary.Add(3, 3);
        orderDictionary.Add(10, 4);
        orderDictionary.Add(11, 5);
        orderDictionary.Add(12, 6);

        Console.WriteLine("========== 默认哈希表（无序） ==========");
        foreach (var value in dictionary.Values)
        {
            Console.WriteLine(value);
        }

        Console.WriteLine("\n按 Enter 键继续...");
        Console.ReadLine();

        Console.WriteLine("========== 排序哈希表（有序） ==========");
        foreach (var value in orderDictionary.Values)
        {
            Console.WriteLine(value);
        }
    }
}
